package com.wind.trademark.file.model;
// default package

import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

/**
 * DoFile entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "fi_file", catalog = "mypro")
public class FiFile implements java.io.Serializable {

	// Fields

	private Long id;
	private Long parent;
	private Long taskId;
	private String type;
	private String name;
	private String description;
	private List<FiFile> children;

	
	// Constructors



	/** default constructor */
	public FiFile() {
	}

	/** minimal constructor */
	public FiFile(Long id) {
		this.id = id;
	}


	@Id
	@GeneratedValue(generator = "generator")    
	@GenericGenerator(name = "generator", strategy = "increment") 
	@Column(name = "ID", unique = true, nullable = false)
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@Column(name = "PARENT")
	public Long getParent() {
		return this.parent;
	}

	public void setParent(Long parent) {
		this.parent = parent;
	}

	@Column(name = "NAME", length = 400)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "DESCRIPTION", length = 800)
	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}
	@Column(name = "TYPE", length = 30)
	public String getType() {
		return type;
	}


	public void setType(String type) {
		this.type = type;
	}
	
	@Column(name = "TASK_ID", nullable = true)
	public Long getTaskId() {
		return taskId;
	}

	public void setTaskId(Long taskId) {
		this.taskId = taskId;
	}
	
	@OneToMany(fetch=FetchType.LAZY )
	@JoinColumn(name="PARENT",updatable=false)
	public List<FiFile> getChildren() {
		return children;
	}

	public void setChildren(List<FiFile> children) {
		this.children = children;
	}
}